<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});

// 注册
Route::any('register', 'Api\UserController@register');
// 登陆
Route::post('login', 'Api\UserController@login');
// 忘记密码
Route::post('forget_pwd', 'Api\UserController@forgetPwd');
// 发送验证码
Route::post('send', 'Api\SmsController@sendsms');
//  系统设置-设置位置信息
Route::post('system/regionSet', 'Api\SystemController@regionSet');
// 广告位
Route::post('adv/get_adv_content', 'Api\AdvController@getAdvContent');
Route::post('adv/guide_adv', 'Api\AdvController@guideAdv');
// 首页非地区相关广告位
Route::post('adv/index_page', 'Api\AdvController@indexAdvContent');
// 首页地区相关广告位
Route::post('adv/village_index_page', 'Api\AdvController@villageIndexAdvContent');



// 文章管理 
//Route::post('article/index', 'Api\ArticleController@index');
Route::post('article/index', 'Api\ArticleController@article_list');
Route::post('article/toplist', 'Api\ArticleController@article_list');
Route::post('article/details', 'Api\ArticleController@details');
Route::post('article/get_child_article', 'Api\ArticleController@getChildArticle');
Route::post('article/article_img_video', 'Api\ArticleController@articleImgVideo');
Route::post('article/get_video', 'Api\ArticleController@getVideo');
Route::post('article/article_inc_read', 'Api\ArticleController@articleIncRead');             #  文章阅读自增
Route::post('article/get_child_category', 'Api\ArticleController@getChildCategory');         #  获取父类下的子类
Route::get('article/top', 'Api\ArticleController@article_to_top');



// 商品
Route::post('agric_goods/get_agric_goods','Api\AgricGoodsController@getAgricGoods');                  #  获取某类商品
Route::post('agric_goods/details','Api\AgricGoodsController@details');                                #  获取某个商品详情页
Route::post('agric_goods/get_agric_category','Api\AgricGoodsController@getAgricCategory');            #  获取商品分类



// 各种反馈
Route::post('feedback/paper_commit', 'Api\FeedbackController@paperCommit');                            #  问卷调查提交
Route::post('feedback/get_paper', 'Api\FeedbackController@getPaper');                                  #  获取问卷

// 乡村在线
Route::post('village_publish/village_pub_list','Api\VillagePublishController@villagePublishList');      #  列表
Route::post('village_publish/details','Api\VillagePublishController@details');                          #  详情页


//  获取位置信息
Route::post('user/lng_lat', 'Api\UserController@lngLat');                                 #  经纬度获取位置信息

// 下载
Route::post('upload/download_log','Api\UploadController@downloadLog');                    #  下载app记录
Route::post('download/get_app_new_version','Api\DownloadController@getAppNewVersion');    #  获取app最新版本信息
Route::get('download/download_apk','Api\DownloadController@downloadApk');                 #  下载APK


//  获取位置信息
Route::post('user/address', 'Api\UserController@addressNew');                                 #   获取位置信息


// 搜索
Route::post('search','Api\SearchController@search');                                          #   获取搜索文章视频


//  配置文章
Route::post('system/protocol','Api\SystemController@protocol');                               #   配置文章


//  预约
Route::post('reservation','Api\ReservationController@index');                                  #   预约列表
Route::post('reservation/expert_list','Api\ReservationController@expertList');                 #   专家列表
Route::post('reservation/category','Api\ReservationController@category');                      #   预约农业指导分类表
Route::post('reservation/details','Api\ReservationController@details');                        #   预约详情


//  大事小情
Route::post('village_things','Api\VillageThingsController@index');                             #   大事小情
Route::post('village_things/details','Api\VillageThingsController@details');                   #   大事小情详情页


//  地区
Route::post('system_region','Api\SystemController@systemRegion');                                   #   地区列表


// 积分规则表
Route::post('user/integral_rule','Api\UserController@integralRule');                                #   积分规则

Route::post('user/integral_operate', 'Api\UserController@integralOperate');             #  录入积分记录

// 签到
Route::post('clockin/alert','Api\ClockInController@getAlertDayInfo');                                   #  弹框签到信息


//  获取房间总人数
Route::post('get_room_user_num','Api\MeetingController@getRoomUserNum');                             #   获取房间总人数
Route::post('meeting/room_get_out','Api\MeetingController@roomGetOut');                              #   房间踢人


//  视频直播回调
Route::post('meeting/login_room_back','Api\MeetingController@loginRoomBack');                     #    登录房间回调
Route::post('meeting/logout_room_back','Api\MeetingController@logoutRoomBack');                   #    退出房间回调
Route::post('meeting/stream_create_back','Api\MeetingController@streamCreateBack');               #    流创建回调
Route::post('meeting/stream_close_back','Api\MeetingController@streamCloseBack');                 #    流关闭回调
Route::post('meeting/get_simple_stream_list','Api\MeetingController@getSimpleStreamList');              #   获取简易房间流


//  测试接口
Route::post('article/test','Api\ArticleController@test');


// 需要token的接口
Route::Group(['middleware' => 'api.auth'], function () {

    // 获得用户信息
    Route::post('get_user', 'Api\UserController@getUser');

    // 用户
    Route::post('user/user_info', 'Api\UserController@userInfo');
    Route::post('user/index', 'Api\UserController@index');
    Route::post('user/follow_or_cancel', 'Api\UserController@followOrCancel');        #  关注或取消关注
    Route::post('user/userinfo_followed', 'Api\UserController@userinfoFollowed');     #  被关注者的个人信息
    Route::post('user/my_follows', 'Api\UserController@myFollows');                   #  我的关注
    Route::post('user/my_collects', 'Api\UserController@myCollects');                 #  我的喜欢和收藏
    Route::post('user/my_collects_del', 'Api\UserController@myCollectsDel');          #  我的喜欢和收藏的删除
    Route::post('user/my_pub_article_or_video', 'Api\UserController@myPubArticleOrVideo');         #  我的发布的文章或视频
    Route::post('user/my_pub_village_things', 'Api\UserController@myPubVillageThings');            #  我的发布的大事小情
    Route::post('user/get_invite_code', 'Api\UserController@getInviteCode');             #  获取邀请码
    Route::post('user/back_invite_code', 'Api\UserController@backInviteCode');             #  获取邀请码
    Route::post('user/integral_records', 'Api\UserController@integralRecords');             #  积分记录表
    Route::post('user/avatar_set', 'Api\UserController@avatarSet');                        #  用户头像设置


    //  党务
    Route::post('party/homepage', 'Api\PartyController@homepage');                           #   首页
    Route::post('party/write_letters', 'Api\PartyController@writeLetters');                  #   写信
    Route::post('party/party_user_list', 'Api\PartyController@partyUserList');               #   党总支

    //  文章
    Route::post('article/article_operated', 'Api\ArticleController@articleOperated');        #  文章各种操作  点赞、收藏等

    //  反馈
    Route::post('feedback/opinions', 'Api\FeedbackController@opinions');                  #  意见反馈提交
    Route::post('feedback/appeal_form', 'Api\FeedbackController@appealForm');             #  诉求建议提交
    Route::post('feedback/farmer_form', 'Api\FeedbackController@farmerForm');             #  民情反馈


    // 上传文件
    Route::post('upload/upload_file','Api\UploadController@uploadFile');                  #  上传文件
    Route::post('upload/upload_imgs','Api\UploadController@uploadImgs');                  #  多文件上传


    // 商品
    Route::post('agric_goods/agric_goods_operated_logs','Api\AgricGoodsController@agricGoodsOperatedLogs');             #  对某商品感兴趣


    // 乡村在线
    Route::post('village_publish','Api\VillagePublishController@villagePublish');                                   #   农品助力发布
    Route::post('village_publish/village_pub_check','Api\VillagePublishController@villagePubCheck');                #   审核
    Route::post('village_publish/village_pub_operated','Api\VillagePublishController@villagePubOperated');          #   乡村在线的各种操作


    // 搜索
    Route::post('search/get_history_search','Api\SearchController@getHistorySearch');                         #   获取历史搜索记录
    Route::post('search/add_or_del_history_search','Api\SearchController@addOrDelHistorySearch');             #   添加或删除历史搜索记录


    // 预约
    Route::post('reservation/add','Api\ReservationController@addReservation');                                       #   预约添加
    Route::post('reservation/comment','Api\ReservationController@comment');                                          #   预约评论
    Route::post('reservation/reservation_operate_logs','Api\ReservationController@reservationOperateLogs');          #   预约评论操作
    Route::post('reservation/comment_more','Api\ReservationController@commentMore');                                 #   更多评论


    // 大事小情
    Route::post('village_things/add','Api\VillageThingsController@addVillageThings');                                       #   大事小情的添加
    Route::post('village_things/comment','Api\VillageThingsController@comment');                                            #   大事小情的评论
    Route::post('village_things/village_things_operate_logs','Api\VillageThingsController@VillageThingsOperateLogs');       #   大事小情的操作
    Route::post('village_things/comment_more','Api\VillageThingsController@commentMore');                                   #   更多评论

    // 签到
//    Route::post('clockin/alert','Api\ClockInController@getAlertDayInfo');                                   #  弹框签到信息
    Route::post('clockin/month','Api\ClockInController@signCalendar');                                   #  签到页面信息
    Route::post('clockin/sign','Api\ClockInController@clock_in');                                   #  签到提交


    //  视频会议
    Route::post('meeting/check_room_secret','Api\MeetingController@checkRoomSecret');                #     验证房间密钥
    Route::post('meeting','Api\MeetingController@meetingInfo');                                      #     直播间信息
    Route::post('meeting/meeting_operate','Api\MeetingController@meetingOperate');                 #     登入、退出房间、连麦或取消连麦
    Route::post('meeting/get_room_user_list','Api\MeetingController@getRoomUserList');               #     直播间用户表
    Route::post('meeting/add_stream','Api\MeetingController@addStream');                           #     增加房间流
    Route::post('meeting/del_stream','Api\MeetingController@delStream');                           #     删除房间流



});
Route::post('test/ali_upload_test','Api\ArticleController@ali_upload_test');